package com.infore.qualityControl.controller;


import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.infore.qualityControl.bo.QualityParamOutSelectBo;
import com.infore.qualityControl.remoteService.IDataAuditService;
import com.infore.qualityControl.remoteService.IDataReceivingService;
import com.infore.qualityControl.remoteService.ISiteManageService;
import com.infore.qualityControl.select.dto.QueryParamDto;
import com.infore.qualityControl.select.util.PageObject;
import com.infore.qualityControl.service.ICreateQualityDataService;
import com.infore.qualityControl.service.IQualityControlSetService;
import com.infore.qualityControl.service.ITestDataService;
import com.infore.qualityControl.util.JsonUtils;
import com.infore.qualityControl.util.ObjectMapperUtil;
import com.infore.qualityControl.util.ResultEntity;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Controller
public class TestController {
	
	private static final Logger logger = LoggerFactory.getLogger(TestController.class);
	
	@Autowired
	ICreateQualityDataService ICreateQualityDataService;
	
	@Autowired
	ITestDataService ITestDataService;
	
	@Autowired
	IDataAuditService IDataAuditService;
	
	@Autowired
	IQualityControlSetService IQualityControlSetService;
	
	@Autowired
	ObjectMapperUtil ObjectMapperUtil;
	
	@Autowired
	IDataReceivingService IDataReceivingService;
	
	@Autowired
	ISiteManageService ISiteManageService;
	
	@ApiOperation(value = "测试接口")
	@ApiImplicitParams({
		@ApiImplicitParam(name = "msg", value = "测试参数", paramType = "query", required = true, dataType = "String"),
	})
	@RequestMapping(value = "/test/msg", method = RequestMethod.POST)
	@ResponseBody
	public ResultEntity test(QualityParamOutSelectBo bo, PageObject pageObject) {
		List<String> siteDayTimeList = new ArrayList<>();
		siteDayTimeList.add("a");
		siteDayTimeList.add("b");
		siteDayTimeList.add("c");
		String timeArr = "";
		QueryParamDto queryParamDto = null;
		try {
			queryParamDto = JsonUtils.readJsonFromClassPath("/queryParam/siteQuery.json", QueryParamDto.class);
		} catch (IOException e) {
			e.printStackTrace();
		}
		return IDataAuditService.queryAuditDataByTimeAndMns(bo);
	}
	
}
